package cn.dy.sbo.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import cn.common.lib.springside.entity.AutoIdEntity;

/**
 * 订单处理历史
 * @author mlv
 *
 */
@Entity
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class FlowHis extends AutoIdEntity{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private	Flow		step;
	private	String		stepCode;
	private	Date		beginDate;
	private	Integer		beginTime;
	private	Date		endDate;
	private	Integer		endTime;
	private	String		endFlag;
	
	private Integer		docEntry;
	
	private	Orders		orders;//单据
	
	private String Col1;
	private String Col2;
	private String Col3;
	private String Col4;
	private String Col5;
	private String Col6;
	private String Col7;
	private String Col8;
	private String Col9;
	private String Col10;
	private String Col11;
	private String Col12;
	private String Col13;
	private String Col14;
	private String Col15;
	private String Col16;
	private String Col17;
	private String Col18;
	private String Col19;
	private String Col20;
	private String Col21;
	private String Col22;
	private String Col23;
	private String Col24;
	private String Col25;
	private String Col26;
	private String Col27;
	private String Col28;
	private String Col29;
	private String Col30;
	private String Col31;
	private String Col32;
	private String Col33;
	private String Col34;
	private String Col35;
	private String Col36;
	private String Col37;
	private String Col38;
	private String Col39;
	private String Col40;
	
	private String colJson;

	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
	public Flow getStep() {
		return step;
	}

	public void setStep(Flow step) {
		this.step = step;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Column(length=20)
	public String getStepCode() {
		return stepCode;
	}

	public void setStepCode(String stepCode) {
		this.stepCode = stepCode;
	}
	
	@Transient
	public String getBeginTimeStr() {
		if(beginTime == null)
			return "";
		String s = String.valueOf(beginTime);
		if(s.length() < 3)
			return s;
		return s.substring(0, 2) + ":" + s.substring(2);
	}

	public Integer getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(Integer beginTime) {
		this.beginTime = beginTime;
	}

	public Integer getEndTime() {
		return endTime;
	}
	
	@Transient
	public String getEndTimeStr() {
		if(endTime == null)
			return "";
		String s = String.valueOf(endTime);
		if(s.length() < 2)
			return s;
		return s.substring(0, 1) + ":" + s.substring(2);
	}

	public void setEndTime(Integer endTime) {
		this.endTime = endTime;
	}
	
	public Integer getDocEntry() {
		return docEntry;
	}

	public void setDocEntry(Integer docEntry) {
		this.docEntry = docEntry;
	}

	@Column(length=5)
	public String getEndFlag() {
		return endFlag;
	}

	public void setEndFlag(String endFlag) {
		this.endFlag = endFlag;
	}

	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
	public Orders getOrders() {
		return orders;
	}

	public void setOrders(Orders orders) {
		this.orders = orders;
	}

	
	@Column(length=300)
	public String getCol1() {
		return Col1;
	}

	public void setCol1(String col1) {
		Col1 = col1;
	}

	@Column(length=300)
	public String getCol2() {
		return Col2;
	}

	public void setCol2(String col2) {
		Col2 = col2;
	}

	@Column(length=300)
	public String getCol3() {
		return Col3;
	}

	public void setCol3(String col3) {
		Col3 = col3;
	}

	@Column(length=300)
	public String getCol4() {
		return Col4;
	}

	public void setCol4(String col4) {
		Col4 = col4;
	}

	@Column(length=300)
	public String getCol5() {
		return Col5;
	}

	public void setCol5(String col5) {
		Col5 = col5;
	}

	@Column(length=300)
	public String getCol6() {
		return Col6;
	}

	public void setCol6(String col6) {
		Col6 = col6;
	}

	@Column(length=300)
	public String getCol7() {
		return Col7;
	}

	public void setCol7(String col7) {
		Col7 = col7;
	}

	@Column(length=300)
	public String getCol8() {
		return Col8;
	}

	public void setCol8(String col8) {
		Col8 = col8;
	}

	@Column(length=300)
	public String getCol9() {
		return Col9;
	}

	public void setCol9(String col9) {
		Col9 = col9;
	}

	@Column(length=300)
	public String getCol10() {
		return Col10;
	}

	public void setCol10(String col10) {
		Col10 = col10;
	}

	@Column(length=300)
	public String getCol11() {
		return Col11;
	}

	public void setCol11(String col11) {
		Col11 = col11;
	}

	@Column(length=300)
	public String getCol12() {
		return Col12;
	}

	public void setCol12(String col12) {
		Col12 = col12;
	}

	@Column(length=300)
	public String getCol13() {
		return Col13;
	}

	public void setCol13(String col13) {
		Col13 = col13;
	}

	@Column(length=300)
	public String getCol14() {
		return Col14;
	}

	public void setCol14(String col14) {
		Col14 = col14;
	}

	@Column(length=300)
	public String getCol15() {
		return Col15;
	}

	public void setCol15(String col15) {
		Col15 = col15;
	}

	@Column(length=300)
	public String getCol16() {
		return Col16;
	}

	public void setCol16(String col16) {
		Col16 = col16;
	}

	@Column(length=300)
	public String getCol17() {
		return Col17;
	}

	public void setCol17(String col17) {
		Col17 = col17;
	}

	@Column(length=300)
	public String getCol18() {
		return Col18;
	}

	public void setCol18(String col18) {
		Col18 = col18;
	}

	@Column(length=300)
	public String getCol19() {
		return Col19;
	}

	public void setCol19(String col19) {
		Col19 = col19;
	}

	@Column(length=300)
	public String getCol20() {
		return Col20;
	}

	public void setCol20(String col20) {
		Col20 = col20;
	}

	@Column(length=300)
	public String getCol21() {
		return Col21;
	}

	public void setCol21(String col21) {
		Col21 = col21;
	}

	@Column(length=300)
	public String getCol22() {
		return Col22;
	}

	public void setCol22(String col22) {
		Col22 = col22;
	}

	@Column(length=300)
	public String getCol23() {
		return Col23;
	}

	public void setCol23(String col23) {
		Col23 = col23;
	}

	@Column(length=300)
	public String getCol24() {
		return Col24;
	}

	public void setCol24(String col24) {
		Col24 = col24;
	}

	@Column(length=300)
	public String getCol25() {
		return Col25;
	}

	public void setCol25(String col25) {
		Col25 = col25;
	}

	@Column(length=300)
	public String getCol26() {
		return Col26;
	}

	public void setCol26(String col26) {
		Col26 = col26;
	}

	@Column(length=300)
	public String getCol27() {
		return Col27;
	}

	public void setCol27(String col27) {
		Col27 = col27;
	}

	@Column(length=300)
	public String getCol28() {
		return Col28;
	}

	public void setCol28(String col28) {
		Col28 = col28;
	}

	@Column(length=300)
	public String getCol29() {
		return Col29;
	}

	public void setCol29(String col29) {
		Col29 = col29;
	}

	@Column(length=300)
	public String getCol30() {
		return Col30;
	}

	public void setCol30(String col30) {
		Col30 = col30;
	}

	@Column(length=300)
	public String getCol31() {
		return Col31;
	}

	public void setCol31(String col31) {
		Col31 = col31;
	}

	@Column(length=300)
	public String getCol32() {
		return Col32;
	}

	public void setCol32(String col32) {
		Col32 = col32;
	}

	@Column(length=300)
	public String getCol33() {
		return Col33;
	}

	public void setCol33(String col33) {
		Col33 = col33;
	}

	@Column(length=300)
	public String getCol34() {
		return Col34;
	}

	public void setCol34(String col34) {
		Col34 = col34;
	}

	@Column(length=300)
	public String getCol35() {
		return Col35;
	}

	public void setCol35(String col35) {
		Col35 = col35;
	}

	@Column(length=300)
	public String getCol36() {
		return Col36;
	}

	public void setCol36(String col36) {
		Col36 = col36;
	}

	@Column(length=300)
	public String getCol37() {
		return Col37;
	}

	public void setCol37(String col37) {
		Col37 = col37;
	}

	@Column(length=300)
	public String getCol38() {
		return Col38;
	}

	public void setCol38(String col38) {
		Col38 = col38;
	}

	@Column(length=300)
	public String getCol39() {
		return Col39;
	}

	public void setCol39(String col39) {
		Col39 = col39;
	}

	@Column(length=300)
	public String getCol40() {
		return Col40;
	}

	public void setCol40(String col40) {
		Col40 = col40;
	}

	@Transient
	public String getColJson() {
		return colJson;
	}

	public void setColJson(String colJson) {
		this.colJson = colJson;
	}
	
	
	
}
